window: Make resize cursors work for modal dialogs
authorMatthias Clasen <mclasen@redhat.com>
Mon, 13 Apr 2020 02:18:50 +0000 (22:18 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 13 Apr 2020 02:18:50 +0000 (22:18 -0400)
We were inadvertedly not letting the grab_widget determine
a cursor. This was showing up as resize cursors not appearing.

gtk/gtkwindow.c

index ee27db076cc5533e593aa712a9444f9573f4f7ef..69e3e7a3998bf933e5b7f25c1f93c09af5a0a431 100644 (file)
@@ -7915,7 +7915,7 @@ update_cursor (GtkWindow *toplevel,
 
   surface = gtk_native_get_surface (gtk_widget_get_native (target));
 
-  if (grab_widget && !gtk_widget_is_ancestor (target, grab_widget))
+  if (grab_widget && !gtk_widget_is_ancestor (target, grab_widget) && target != grab_widget)
     {
       /* Outside the grab widget, cursor stays to whatever the grab
        * widget says.
@@ -7932,9 +7932,6 @@ update_cursor (GtkWindow *toplevel,
        */
       while (target)
         {
-          if (grab_widget && target == grab_widget)
-            break;
-
           /* Don't inherit cursors across surfaces */
           if (surface != gtk_native_get_surface (gtk_widget_get_native (target)))
             break;
@@ -7947,6 +7944,9 @@ update_cursor (GtkWindow *toplevel,
           if (cursor)
             break;
 
+          if (grab_widget && target == grab_widget)
+            break;
+
           target = _gtk_widget_get_parent (target);
         }
     }